<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>群裂变</title>
{$h->import('static/layui/layui.css')}
{$h->import('static/css/public.css')}
{$h->import('static/js/ajax.js')}
{$h->import('static/layui/layui.js')}
{$h->import('static/layui/lay/modules/element.js')}
{$h->import('static/layui/lay/modules/layer.js')}
{$h->import('static/layui/css/modules/layer/default/layer.css')}
{$h->import('static/layui/lay/modules/form.js')}
{$h->import('static/layui/css/modules/laydate/default/laydate.css')}
{$h->import('static/layui/css/modules/code.css')}

<div style="display: none;">
{$h->import('static/layui/css/modules/layer/default/loading-1.gif')}
{$h->import('static/layui/css/modules/layer/default/loading-1.gif')}
{$h->import('static/font/iconfont.woff2')}
{$h->import('static/font/iconfont.woff')}
</div>


  <style type="text/css">
    body{
      background: #e9e9e9;
    }
    /*公共头部带搜索*/
    .public_container{
      margin: 20px;
      background: #fff;
    }
    .public_title_container{
      height: 54px;
      padding: 0 20px;
      font-size: 14px;
      display: flex; 
      align-items: center;
      background: #f9f9f9;
      border-bottom: 1px solid #f0f0f0;
    }
    .public_buttonSearch_container{
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px;
      background: #fff;
    }
    .public_buttonSearch_container a{
      color: #fff;
      background-color: #1E9FFF;
      text-shadow: 0 -1px 0 rgba(0,0,0,.12);
      height: 24px;
      padding: 4px 15px;
      font-size: 14px;
      border-radius: 2px;
      display: flex;
      align-items: center;
    }
    .public_Search_container{
      position: relative;
    }
    .public_Search_container input{
      width: 240px;
      height: 32px;
      border: 1px solid #d9d9d9;
    }
    .public_Search_container i{
      position: absolute;
      bottom: 6px;
      right: 10px;
      cursor: pointer;
    }
    .chat-li {
        margin-bottom: 8px;
        display: -webkit-box;
        display: flex;
        -webkit-box-align: center;
        align-items: center;
        box-sizing: border-box;
    }
    .chat-info>img {
        width: 30px;
        height: 30px;
        margin-right: 7px;
    }
    .chat-status.red {
        background: #fbe3e2;
        border: 1px solid #ffb4b4;
    }
    .chat-status.green {
        background: #e8fcdc;
        border: 1px solid #a1ec9f;
    }
    .chat-status.gray {
        background: #f2f2f2;
        border: 1px solid #d1d1d1;
    }
    .chat-status {
        width: 58px;
        height: 22px;
        font-size: 12px;
        line-height: 22px;
        color: rgba(0,0,0,.65);
        text-align: center;
        border-radius: 2px;
        margin-left: 16px;
        word-break: keep-all;
        white-space: nowrap;
    }
    .chat-info {
        width: 160px;
        height: 38px;
        padding: 12px 13px;
        background: #fff;
        border: 1px solid #e6e6e6;
        box-sizing: border-box;
        border-radius: 2px;
        display: -webkit-box;
        display: flex;
        -webkit-box-align: center;
        align-items: center;
    }
    .chat-list-wrap {
        max-height: 90px;
    }
  </style>
</head>
<body>
     <!-- 顶部提示框 开始 -->
     <div class="public_tipSetting_contaienr">
          <div class="public_tipSetting_content">
               <p>通过在企业后台建立群裂变任务，企业可邀请客户参与活动，客户进群并邀请好友进群后即完成任务，是一个通过以旧带新的方式提高客户群内客户量增长的工具。</p>
               <svg t="1599462804099" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8813" width="15" height="15"><path d="M512 102.4a409.6 409.6 0 1 0 409.6 409.6 409.6 409.6 0 0 0-409.6-409.6z m181.248 518.144a51.2 51.2 0 0 1-72.704 72.704L512 584.192l-108.544 109.056a51.2 51.2 0 0 1-72.704-72.704L439.808 512 330.752 403.456a51.2 51.2 0 0 1 72.704-72.704L512 439.808l108.544-109.056a51.2 51.2 0 0 1 72.704 72.704L584.192 512z" fill="" p-id="8814"></path></svg>
          </div>
     </div>
    <!-- 顶部提示框 开始 -->
  <div class="public_tipSetting_contaienr">
    <ul class="public-header-nav">
      <li><a class="public-header-nav-active" href="index.html">活动列表</a></li>
      <li><a href="fission_statistics.html">数据分析</a></li>
      <li><a href="convert_list.html">群裂变兑换码</a></li>
      <li><a href="set_gzh.html">公众号配置</a></li>
    </ul>
  </div>
  <!-- 顶部提示框 结束 -->
  <div class="public_container">
    <!-- /*公共头部带搜索*/ -->
    <div class="public_content">
      <div class="public_title_container">
        <p>群裂变</p>
      </div>
      <div class="public_buttonSearch_container">
        <a href="create_fission.html">+ 新建活动</a>
        <form  method="get" action="" id="Form1">
        <div class="public_Search_container">
          <input type="text" name="name" value="{$name}" required  lay-verify="required" placeholder="搜索活动名称" autocomplete="off" class="layui-input">
          <i class="layui-icon layui-icon-search" onclick="document.getElementById('Form1').submit()"></i>
        </div>
        </form>
      </div>
    </div>
    <!-- /*公共头部带搜索*/ end -->
    <!-- 公共表格部分 -->
    <div class="public_table_container">
      <table class="layui-table" lay-skin="line">
          <thead>
            <tr>
              <th>活动名称</th>
              <th>创建时间</th>
              <th>结束时间</th>
              <th>参与活动人数</th>
              <th>状态</th>
              <th>群聊</th>
              <th>操作</th>
            </tr> 
          </thead>
          <tbody>
        {loop $fission_list as $fission}
            <tr>
              <td>{$fission['name']}</td>
              <td>{$fission['ctime']}</td>
              <td>{$fission['endtime']}</td>
              <td>{$fission['counts']?:0;}</td>
              <td>{if $fission['status']==2}配置欢迎语失败{else if $fission['status']==3}群聊已拉满，活动已结束{else if time() > strtotime($fission["endtime"])}活动已结束{else}活动进行中{/if}</td>
              <td>
                <div class="chat-list-wrap ">
                  <ul class="chat-list" data-chat="index">
                    {loop $fission["group_code_data"] as $key=>$data}
                    <li class="chat-li">
                      <div class="chat-info">
                        <img src="{$data['group_code']}"> 
                        <span class="chat-name">{$this->get_group_name($data['group_chat_id'])}</span>
                      </div>
                      {if $data["status"] == 2}
                        <div class="chat-status green">拉人中</div>
                      {else if $data["status"] == 3}
                        <div class="chat-status red">已达上限</div>
                      {else if $data["status"] == 1}
                        <div class="chat-status gray">未开启</div>
                      {/if}
                    </li>
                    {/loop}
                  </ul>
                </div>
              <td>
          <a type="button" class="table-public-btn" onclick="particulars({$fission['id']})">详情</a>
            {if $fission['status']==3}
                <a class="table-public-btn" href="#">编辑</a>
                <a class="table-public-btn" href="#">邀请客户参与</a>
            {else if time() > strtotime($fission["endtime"])}
                <a class="table-public-btn" href="#">编辑</a>
                <a class="table-public-btn" href="#">邀请客户参与</a>
            {else}
                <a class="table-public-btn" href="edit_fission-{$fission['id']}.html">编辑</a>
                <a class="table-public-btn" href="invitation-{$fission['id']}.html">邀请客户参与</a>
            {/if}
          <a type="button" class="table-public-btn" onclick="del_group({$fission['id']})">删除</a>
          </td>
            </tr>
        {/loop}
          </tbody>
      </table>
    </div>
    <!-- 公共表格部分 end-->
    <div class="main-container-h pageing-container-h">
            <div class="pageing-content-h">
               <span>{$p->totalnum}条/{$p->totalpage}页</span> 
            </div>
        <ul class="pageing-content-h">
               {P weidogsadmin}
        </ul>
        </div>
  </div>
<script src="/cdn/jquery.js"></script>

<script type="text/javascript">
layui.use(['element', 'layer', 'form'], function () {

})
$('.public_tipSetting_contaienr svg').click(function(){
  $('.public_tipSetting_contaienr').hide();
})

function del_group(id){
  myAjaxPost(false, true, 'del_group.html', { id:id}, function (resp) {
    tusi(resp.msg);
    if(resp.status == "success"){
      setTimeout(function(){
        location.reload();
      },1000);
    }
  });
}
function particulars(id){
  layer.open({
        type: 2,
        title: '请选择使用人员',
        shadeClose: true,
        shade: 0.2,
        area: ['850px', '600px'],
        content: 'particulars-'+id+'.html'
    }); 
}
</script>
</body>
</html>